@PACKAGE_INIT@

if (@SLAM_PARAVIEW_PLUGIN@)
  # Workaround to avoid circular dependency between LidarSlamLib and LidarSlamPlugin
  add_library(vtkLidarSlam SHARED IMPORTED)
endif ()

include("${CMAKE_CURRENT_LIST_DIR}/LidarSlamLib-targets.cmake")

if (@SLAM_PARAVIEW_PLUGIN@)
  include("${CMAKE_CURRENT_LIST_DIR}/LidarSlamLib-paraview-plugin-properties.cmake")
endif ()

include(CMakeFindDependencyMacro)

find_dependency(Boost REQUIRED)

find_dependency(nanoflann REQUIRED)

find_dependency(Eigen3 QUIET)

find_dependency(Ceres REQUIRED)

find_dependency(PCL REQUIRED COMPONENTS common io octree geometry
                OPTIONAL_COMPONENTS @pcl_for_teaser@)

# Find optional g2o (only used for pose graph optimization)
if (@g2o_FOUND@)
  find_dependency(g2o QUIET)
else()
  message(STATUS "LidarSlam: G2O was not found, pose graph API disabled")
endif()

# Find optional gtsam (only used for pose IMU raw data integration)
if (@GTSAM_FOUND@)
  find_dependency(GTSAM QUIET)
else()
  message(STATUS "LidarSlam: GTSAM was not found, IMU preintegration disabled")
endif()

# Find optional OpenMP
if (@OpenMP_FOUND@)
  find_dependency(OpenMP QUIET)
else()
  message(STATUS "LidarSlam: OpenMP was not found, multi-threading for SLAM disabled")
endif()

# Find optional teaserpp (only used for automatic detection of loop closure)
if (@teaserpp_FOUND@)
  find_dependency(teaserpp QUIET)
else()
  message("Lidar SLAM : TEASER++ was not found, automatic loop closure detection disabled")
endif()

check_required_components(LidarSlam)